// 用户系统样式
export default {
	namespaced: true,
	state: {
		// 动态菜单路由
		dynamicMenuRoutes: [],
		// 权限
		permissions: [],
		// 导航条, 布局风格, defalut(默认) / inverse(反向)
		navbarLayoutType: 'inverse',
		// 侧边栏, 布局皮肤, light(浅色) / dark(黑色)
		sidebarLayoutSkin: 'light',
		// 侧边栏, 折叠状态
		sidebarFold: false,
		// 侧边栏, 菜单
		menus: [],
		// 侧边栏默认打开菜单名称
		menuActiveName: '',
		// 清除菜单选中
		menuClear: false,
		
		// 导航标题
		navTitle: '导航标题',
		// 导航是否显示
		navShow: true
	},
	mutations: {
		SET_OBJECT: (state, obj) => {
			for (let [key, value] of Object.entries(obj)) {
				state[key] = value
			}
		},
		SET_DYNAMICMENUROUTES(state, dynamicMenuRoutes) {
			state.dynamicMenuRoutes = dynamicMenuRoutes
		},
		SET_PERMISSIONS(state, permissions) {
			state.permissions = permissions
		},
		SET_NAVBARLAYOUTTYPE(state, type) {
			state.navbarLayoutType = type
		},
		SET_SIDEBARLAYOUTSKIN(state, skin) {
			state.sidebarLayoutSkin = skin
		},
		SET_SIDEBARFOLD(state, fold) {
			state.sidebarFold = fold
		},
		SET_MENUS(state, menus) {
			state.menus = menus
		},
		SET_MENUACTIVENAME(state, name) {
			state.menuActiveName = name
		},
		SET_MENUCLEAR(state, menuClear) {
			state.menuClear = menuClear
		},
		SET_NAVTITLE(state, navTitle) {
			state.navTitle = navTitle
		}
	},
	actions: {}
}
